/***************************************************************************
 *   Copyright (C) 2004 by cyril dupuit                                    *
 *   cyrildupuit@hotmail.com                                               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

//*****************************************************************************
// Nom du module : Shell.h
// Description :  Proposer des commandes simple a l'utilisateur afin de
// connaitre le fonctionnement du noyau.
//*****************************************************************************
 
// Historique :
// 28/10/04 : Creation du module V1.0  

#include "Config.h"
#include "Kernel/Types.h"
#include "Misc/Console.h"
#include "Lib/Queue.h"
#include "Lib/LinkList.h"

#ifndef SHELL_HEADER
#define SHELL_HEADER

//*****************************************************************************

#define SHELL_WORD_QUEUE_COUNT 40
#define SHELL_CHAR_BUFFER_SIZE 256
#define MAX_CMD_LINE_COUNT 10

//*****************************************************************************

typedef unsigned long ShellID_t;

//*****************************************************************************

typedef struct SchellHead{
			QueueID_t	QueueID;
			LinkListID_t	LinkListID;
			LNode_t		* pPosition;
			char		* pString;
			Coord_t		StringSize;
			Coord_t		Cursor;
			Coord_t		LineEnd;
			Status_t	InsertMode;
			}Shell_t;

//*****************************************************************************

//*****************************************************************************
// But de la fonction : Afficher l'entete du shell
// Entree : Aucune
// Parametre retourne : ERROR si console non creee, TRUE sinon
//*****************************************************************************
Status_t ShellHeader(void);

//*****************************************************************************
// But de la fonction : lire les saisis de l'utilisateur et agir en
// consequence.
// Entree : Aucune
// Parametre retourne : ERROR si le shell est invalide
//*****************************************************************************
Status_t Shell(void);

//*****************************************************************************
// But de la fonction : Analyser chaque mot composant la chaine de caractere
// Entree :
//	QueueID : Numero d'identification de la file d'attente
// Parametre retourne : FALSE si la file est vide, TRUE sinon
//*****************************************************************************
Status_t ShellStringAnalysis(Shell_t * pShell);

//*****************************************************************************
// But de la fonction : Liberer l'espace memoire emprunte par le shell
// Entree : 
//	pShell : Pointeur sur le shell
// Parametre retourne : TRUE
//*****************************************************************************
Status_t ShellFree(Shell_t * pShell);

//*****************************************************************************

#endif
